﻿using UnityEngine;
using System.Collections;

public class VisionScript : BaseAbility {
	float range = 10.0f;
	
	override public void excecute(GameObject player){
		PlayerVisionScript script = player.GetComponent<PlayerVisionScript> ();
		Collider[] collide = Physics.OverlapSphere (new Vector3 (player.transform.position.x, player.transform.position.y, player.transform.position.z), range, 1 << LayerMask.NameToLayer ("EnemyNPC"));
		if (collide.Length > 0) {
			foreach(Collider col in collide){
				script.addVisibleEnemy(col.gameObject);
			}
		}
	}
}
